package leetcode100;

import java.util.Scanner;

/**
 * @author shkstart
 * @create 2022-12-08-22:08
 */
public class Meme14_1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int c = scanner.nextInt();
        int count = 0;
        int[] arr = new int[]{31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365};
        if (b == 1) {//1月
            count = c;
        } else {//大于等于2月
            //这里分两种，以2月28为分界线，
            //之前只需要 一月份的天数 + 当前的日
            //之后需要对闰年进行判断
            count = arr[b - 2] + c;
            if ((a % 4 == 0 && a % 100 != 0) || a % 400 == 0) {
                if (b > 2) {
                    //闰年
                    count++;
                }
            }
        }
        System.out.println(count);
    }
}
